package cn.kmia.hrm.util;

import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: hrm
 * @description: 常用集合类
 * @author: 4K
 * @create: 2018-08-06 16:17
 **/
public class CommonSet {

    // 审核状态集合
    public static List<String> Verify_Status = new ArrayList<>();

    public static String Verify_Not = "未审核";

    public static String Verify_Pass = "审核通过";

    public static String Verify_NotPass = "审核未通过";

    // 楼层map
    public static Map<Integer, String> FloorMap = new HashMap<>();

    // 岗位关联信息 Map<岗位序列，岗位名称列表>
    public static Map<String, List<String>> PostLinkInfo = new HashMap<>();
    // 岗位性质
    public static List<String> PostTypeInfo = new ArrayList<>();
    // 岗位所在区域
    public static List<String> PostAreaInfo = new ArrayList<>();
    // 岗位名称对应岗位资质要求信息 Map<岗位名称，岗位资质要求信息>
    public static Map<String, String> PostNameRequireInfo = new HashMap<>();
    // 岗位班制
    public static List<String> PostShiftArrangement = new ArrayList<>();
    // 岗位视线情况
    public static List<String> PostSignInfo = new ArrayList<>();

    public static List<String> PostNatureInfo = new ArrayList<>();

    // 工作事件系数
    public static int Worktime_Coefficient = 1;

    // 在岗等待时间系数
    public static double Waittime_Coefficient = 0.5;

    // 休息时间系数
    public static double Resttime_Coefficient = 0.3;

    // 岗位配置系数集合
    public static List<Double> Config_Coefficient = new ArrayList<>();

    // 单班人员配置集合
    public static List<Integer> One_Staffing = new ArrayList<>();

    static {
        Verify_Status.add(Verify_Not);
        Verify_Status.add(Verify_Pass);
        Verify_Status.add(Verify_NotPass);

        FloorMap.put(5, "飞行区");
        FloorMap.put(-1, "B1");
        FloorMap.put(-2, "B2");
        FloorMap.put(1, "1F");
        FloorMap.put(2, "2F");
        FloorMap.put(3, "3F");
        FloorMap.put(4, "4F");

        Config_Coefficient.add(1.0);
        Config_Coefficient.add(1.5);
        Config_Coefficient.add(2.0);
        Config_Coefficient.add(2.5);
        Config_Coefficient.add(3.0);
        Config_Coefficient.add(3.25);
        Config_Coefficient.add(3.5);
        Config_Coefficient.add(3.75);
        Config_Coefficient.add(4.0);
        Config_Coefficient.add(4.25);
        Config_Coefficient.add(4.5);
        Config_Coefficient.add(4.75);

        for (int i = 1; i < 11; i++) {
            One_Staffing.add(i);
        }
    }

    /**
     * 获取岗位图层列表
     *
     * @return
     */
    @At("/floor/get")
    @Ok("json:full")
    public static Map<Integer, String> getFloorMap() {
        return FloorMap;
    }

    /**
     * 获取岗位配置系数
     *
     * @return
     */
    @At("/configCoefficient/get")
    @Ok("json:full")
    public static List<Double> getConfigCoefficient() {
        return Config_Coefficient;
    }

    /**
     * 获取岗位单班人数
     *
     * @return
     */
    @At("/oneStaffing/get")
    @Ok("json:full")
    public static List<Integer> getOneStaffing() {
        return One_Staffing;
    }

}
